#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;
const int maxn=1000000, maxs=1048576, mods=998244353, g=3;

int lo[maxs];

void initLog(int n) {
    for (int i=1; i<=n; i++) lo[i] = lo[i/2]+1;
}

ll qpow(ll a, int n) {
    ll s=1;
    for (; n; n/=2) {
        if (n&1) s=s*a%mods;
        a=a*a%mods;
    }
    return s;
}

void ntt(int n, ll a[], bool inv=false) {
    static int pos[maxs];
    int len=1<<n;
    for (int i=1; i<len; i++) {
        pos[i] = (pos[i>>1]>>1) | ((i&1)<<(n-1));
        if (pos[i]>i) swap(a[i], a[pos[i]]);
    }

    for (int l=1; l<len; l<<=1) {
        ll t=qpow(g, (mods-1)/(2*l)), w, x, y;
        t = inv ? qpow(t, mods-2) : t;
        for (int i=0; i<len; i+=2*l) {
            w = 1;
            for (int j=0; j<l; j++) {
                x=a[i+j], y=a[i+j+l]*w%mods;
                a[i+j]=(x+y)%mods, a[i+j+l]=(x+mods-y)%mods;
                w = w*t%mods;
            }
        }
    }
}

void mul(int na, ll a[], int nb, ll b[], int &nc, ll c[]) {
    static ll x[maxs], y[maxs];
    int len=1<<lo[na+nb], ilen=qpow(len, mods-2);
    memcpy(x, a, sizeof(ll)*(na+1));
    memcpy(y, b, sizeof(ll)*(nb+1));
    for (int i=na+1; i<len; i++) x[i]=0;
    for (int i=nb+1; i<len; i++) y[i]=0;
    ntt(lo[na+nb], x);
    ntt(lo[na+nb], y);
    for (int i=0; i<len; i++) c[i]=x[i]*y[i]%mods;
    ntt(lo[na+nb], c, true);
    for (int i=0; i<len; i++) c[i]=c[i]*ilen%mods;
    nc=na+nb;
}

ll fact[maxn+1], invf[maxn+1];
void initFact(int n) {
    fact[0] = 1;
    for (int i=1; i<=n; i++) fact[i] = fact[i-1]*i%mods;
    invf[n] = qpow(fact[n], mods-2);
    for (int i=n; i; i--) invf[i-1] = invf[i]*i%mods;
}

void build(int n, ll a[], int &nb, ll b[]) {
    static ll f[maxs+1], g[maxs+1], h[maxs+1];
    ll t=1;
    nb = n;
    for (int i=0; i<=n; i++) {
        f[i] = a[n-i]*fact[n-i]%mods;
        g[i] = t*invf[i]%mods;
        t = t*n%mods;
    }
    int temp;
    mul(n, f, n, g, temp, h);
    for (int i=0; i<=n; i++) b[i] = h[n-i]*invf[i]%mods;
}

void forward(int &n, ll a[], ll t) {
    static ll b[maxs+1];
    memcpy(b, a, sizeof(ll)*(n+1));
    for (int i=0; i<=n; i++) {
        a[i] = b[i]*t%mods;
        if (i)  a[i] = (a[i]+b[i-1])%mods;
    }
    a[n+1] = b[n];
    n++;
}

void solve(int n, ll a[]) {
    static ll b[maxn+1];
    int l=1, bl;
    a[0]=2, a[1]=1;
    for (int i=lo[n]-2; i>=0; i--) {
        build(l, a, bl, b);
        mul(l, a, bl, b, l, a);
        if ((n>>i)&1) forward(l, a, l+2);
    }
}

int main() {
    freopen("color.in", "r", stdin);
    freopen("color.out", "w", stdout);

    initLog(maxs);
    static ll a[maxs];
    ll ans=0;
    int n, m;
    scanf("%d %d", &n, &m);
    initFact(maxn);
    solve(n-1, a);
    for (int i=1; i<=m && i<=n; i++) {
        ans = (ans+fact[m-1]*invf[i-1]%mods*invf[m-i]%mods*a[n-i]%mods)%mods;
    }
    printf("%lld\n", ans);

    fclose(stdin);
    fclose(stdout);
    return 0;
}
